package com.sfang.common.redis.enums;


import com.sfang.common.redis.annotations.ExpireSecond;
import com.sfang.common.redis.annotations.WithLocal;

/**
 * Created by psalmody on 2016/8/22.
 */
public enum OauthCacheType implements CacheType {
    @ExpireSecond(864000)
    @WithLocal()
    OAuthAccessToken("OAuthAccessToken", "OAuthAccessToken"),
    @ExpireSecond(3456000)
    @WithLocal()
    OAuthRefreshToken("OAuthRefreshToken", "OAuthRefreshToken"),
    @ExpireSecond(864000)
    @WithLocal()
    OAuthUserDevice("OAuthUserDevice", "OAuthUserDevice"),
    @ExpireSecond(-1)
    @WithLocal()
    OAuthUserInfo("OAuthUserInfo", "OAuthUserInfo"),
    @ExpireSecond(864000)
    @WithLocal()
    DeviceDisable("DeviceDisable", "DeviceDisable"),
    @ExpireSecond(-1)
    @WithLocal()
    OAuthUserBlackList("OAuthUserBlackList", "OAuthUserBlackList"),
    @ExpireSecond(-1)
    @WithLocal()
    OAuthUserBlackWithRemarkList("OAuthUserBlackWithRemarkList", "OAuthUserBlackWithRemarkList"),
    @ExpireSecond(-1)
    @WithLocal()
    OAuthFroceLogoutList("OAuthFroceLogoutList", "OAuthFroceLogoutList"),
    @ExpireSecond(-1)
    @WithLocal()
    OAuthTenantUserBlackList("OAuthTenantUserBlackList", "OAuthTenantUserBlackList"),
    @ExpireSecond(-1)
    @WithLocal()
    OAuthTenantUserBlackWithRemarkList("OAuthTenantUserBlackWithRemarkList", "OAuthTenantUserBlackWithRemarkList"),
    @ExpireSecond(-1)
    @WithLocal()
    OAuthTenantFroceLogoutList("OAuthTenantFroceLogoutList", "OAuthTenantFroceLogoutList"),
    ;

    OauthCacheType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private String code;
    private String desc;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }


    public String sequence() {
        return String.valueOf(this.ordinal());
    }

    public String identifier() {
        return this.name();
    }

    public String identifierExcludeNamespace() {
        return this.name();
    }

}
